Release 10.1A: OpenEdge Development:
AppBuilder
Batch mode: starting and stopping a SmartConsumer
Three properties are generally required before running SmartConsumer object in batch mode, if SonicMQ security checking is turned on. They are
JMSUser,JMSPassword, andClientID. Strictly speaking,ClientIDis not required except when needed to distinguish between sessions using the same user identifier and password.At present, you can set those properties in the instance properties dialog box or from the command line using the
-paramstartup parameter:
In the example shown,
containerfilenamewould be the filename of a simple SmartContainer that contains a SmartConsumer object and a SmartRouter object. The values you pass in the parameter string override any values set at design time using the Instance Properties dialog box.Stopping a SmartConsumer
The most orderly way to shut down a SmartConsumer object running in batch mode is to send a message to the designated shutdown topic or queue. You identify that topic or queue at design time in the
Shutdownproperty.The shutdown message needs no body; its receipt by the shutdown Queue or Topic is sufficient.
When the SmartConsumer detects reception of a message in that Queue/Topic, it sends a shutdown message to its container object. Shutting down the container object shuts down all objects in the container (including the SmartConsumer itself) as well as any containers that were started by the SmartRouter to which the SmartConsumer is connected.
![]()
To set up and test a shutdown mechanism, follow these general steps:
- Create a simple SmartContainer
- Create and place a SmartProducer in the SmartContainer. Set Message Type to HeaderMessage and configure other properties appropriately.
- Create and place a SmartSender in the SmartContainer. If an Advisor offers to create an
OUTMESSAGElink to the SmartProducer, accept the offer; otherwise, create the link using the SmartLinks editor. Set theDestinationproperty to be the shutdown destination for the consumer, for example “Shutdown”. Any message this SmartProducer sends will then be a shutdown message.- Open a Section Editor window and create a local override procedure called
initializeObject. Insert thisRUNstatement as the procedure body:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |